package com.cat.decorator;

/**
 * @author cat
 * @version 2025/5/21 17:14
 * @description 用户类
 * @since JDK17
 */

public class Client {
    public static void main(String[] args) {
        FastFood food = new FriedRice();
        System.out.println(food.getDesc() + " : " + food.getPrice() + "元");
        System.out.println("====================");
        // 加一份鸡蛋
        food = new Egg(food);
        System.out.println(food.getDesc() + " : " + food.cost() + "元");
        System.out.println("====================");
        food = new Egg(food);
        System.out.println(food.getDesc() + " : " + food.cost() + "元");
        System.out.println("====================");
        food = new Bacon(food);
        System.out.println(food.getDesc() + " : " + food.cost() + "元");

    }
}
